//
// Created by 62607 on 25-8-7.
//埃氏筛法
#include <bits/stdc++.h>
using namespace std;

int flag[10001];
vector<int> primes;

int main() {
    int n;
    cin >> n;
    flag[1] = 1;
    for (int i = 2; i * i <= n; i++) {
        if ( flag[i]) continue;
        for (int j = i; i * j <= n; j++) {
            flag[i * j] = 1; //将i的j倍筛掉
        }
    }
    for (int i = 2; i <= n; i++) {
        if (!flag[i]) {
            primes.push_back(i);
        }
    }

    for (int k: primes)
        cout << k << " ";
    return 0;
}
